package me.zhengjie.sqlservice.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import me.zhengjie.mapper.WcsInboundMissionHistoryMapper;
import me.zhengjie.pojo.entity.WcsInboundMissionHistory;
import me.zhengjie.sqlservice.WcsInboundMissionHistoryService;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class WcsInboundMissionHistoryServiceImpl extends ServiceImpl<WcsInboundMissionHistoryMapper, WcsInboundMissionHistory> implements WcsInboundMissionHistoryService {
    private final WcsInboundMissionHistoryMapper wcsInboundMissionHistoryMapper;

    @Override
    public boolean insertInboundHistory(WcsInboundMissionHistory wcsInboundMissionHistory) {
        return wcsInboundMissionHistoryMapper.insert(wcsInboundMissionHistory) > 0;
    }

    @Override
    public WcsInboundMissionHistory selectWcsinboundMissionHistory(String inboundCode) {
        LambdaQueryWrapper<WcsInboundMissionHistory> wcsInboundMissionHistoryLambdaQueryWrapper = new LambdaQueryWrapper<>();
        wcsInboundMissionHistoryLambdaQueryWrapper.eq(WcsInboundMissionHistory::getInboundCode, inboundCode);
        return wcsInboundMissionHistoryMapper.selectOne(wcsInboundMissionHistoryLambdaQueryWrapper);
    }
}
